import socketserver模块

sk = socketserver模块.socket()
sk.bind(('127.0.0.1', 9000))
sk.setblocking(False)
sk.listen()

conn_l = []
while True:
    try:
        conn, addr = sk.accept()
        print(conn)
        conn_l.append(conn)
    except BlockingIOError:
        for c in conn_l:
            try:
                msg = c.recv(1024)
                print(msg)
            except BlockingIOError:
                pass


sk.close()